Optimal. Leaf size=127 \[ -\frac{2 a^2 (a \sin (e+f x)+a)^{m-2} (c-c \sin (e+f x))^n (g \cos (e+f x))^{4-2 m}}{f g (-m+n+2) (-m+n+3)}-\frac{a (a \sin (e+f x)+a)^{m-1} (c-c \sin (e+f x))^n (g \cos (e+f x))^{4-2 m}}{f g (-m+n+3)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.407658, antiderivative size = 127, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 40, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.05, Rules used = {2846, 2844} \[ -\frac{2 a^2 (a \sin (e+f x)+a)^{m-2} (c-c \sin (e+f x))^n (g \cos (e+f x))^{4-2 m}}{f g (-m+n+2) (-m+n+3)}-\frac{a (a \sin (e+f x)+a)^{m-1} (c-c \sin (e+f x))^n (g \cos (e+f x))^{4-2 m}}{f g (-m+n+3)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2846
Rule 2844
Rubi steps
\begin{align*} \int (g \cos (e+f x))^{3-2 m} (a+a \sin (e+f x))^m (c-c \sin (e+f x))^n \, dx &=-\frac{a (g \cos (e+f x))^{4-2 m} (a+a \sin (e+f x))^{-1+m} (c-c \sin (e+f x))^n}{f g (3-m+n)}+\frac{(2 a) \int (g \cos (e+f x))^{3-2 m} (a+a \sin (e+f x))^{-1+m} (c-c \sin (e+f x))^n \, dx}{3-m+n}\\ &=-\frac{2 a^2 (g \cos (e+f x))^{4-2 m} (a+a \sin (e+f x))^{-2+m} (c-c \sin (e+f x))^n}{f g (2-m+n) (3-m+n)}-\frac{a (g \cos (e+f x))^{4-2 m} (a+a \sin (e+f x))^{-1+m} (c-c \sin (e+f x))^n}{f g (3-m+n)}\\ \end{align*}
Mathematica [A] time = 1.32339, size = 143, normalized size = 1.13 \[ -\frac{g^3 \cos ^{2 n}(e+f x) \left (\cos \left (\frac{1}{2} (e+f x)\right )-\sin \left (\frac{1}{2} (e+f x)\right )\right )^4 (g \cos (e+f x))^{-2 m} ((-m+n+2) \sin (e+f x)-m+n+4) (a (\sin (e+f x)+1))^{m-n} \exp (n (\log (a (\sin (e+f x)+1))+\log (c-c \sin (e+f x))-2 \log (\cos (e+f x))))}{f (-m+n+2) (-m+n+3)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 11.848, size = 0, normalized size = 0. \begin{align*} \int \left ( g\cos \left ( fx+e \right ) \right ) ^{3-2\,m} \left ( a+a\sin \left ( fx+e \right ) \right ) ^{m} \left ( c-c\sin \left ( fx+e \right ) \right ) ^{n}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 2.21669, size = 655, normalized size = 5.16 \begin{align*} \frac{{\left (a^{m} c^{n} g^{3}{\left (m - n - 4\right )} - \frac{2 \, a^{m} c^{n} g^{3}{\left (m - n - 6\right )} \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - \frac{a^{m} c^{n} g^{3}{\left (m - n + 12\right )} \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac{4 \, a^{m} c^{n} g^{3}{\left (m - n + 2\right )} \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} - \frac{a^{m} c^{n} g^{3}{\left (m - n + 12\right )} \sin \left (f x + e\right )^{4}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{4}} - \frac{2 \, a^{m} c^{n} g^{3}{\left (m - n - 6\right )} \sin \left (f x + e\right )^{5}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{5}} + \frac{a^{m} c^{n} g^{3}{\left (m - n - 4\right )} \sin \left (f x + e\right )^{6}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{6}}\right )} e^{\left (2 \, n \log \left (\frac{\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - 1\right ) - 2 \, m \log \left (-\frac{\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right ) + m \log \left (\frac{\sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + 1\right ) - n \log \left (\frac{\sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + 1\right )\right )}}{{\left ({\left (m^{2} - m{\left (2 \, n + 5\right )} + n^{2} + 5 \, n + 6\right )} g^{2 \, m} + \frac{3 \,{\left (m^{2} - m{\left (2 \, n + 5\right )} + n^{2} + 5 \, n + 6\right )} g^{2 \, m} \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac{3 \,{\left (m^{2} - m{\left (2 \, n + 5\right )} + n^{2} + 5 \, n + 6\right )} g^{2 \, m} \sin \left (f x + e\right )^{4}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{4}} + \frac{{\left (m^{2} - m{\left (2 \, n + 5\right )} + n^{2} + 5 \, n + 6\right )} g^{2 \, m} \sin \left (f x + e\right )^{6}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{6}}\right )} f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.88668, size = 741, normalized size = 5.83 \begin{align*} \frac{{\left ({\left (m - n - 2\right )} \cos \left (f x + e\right )^{2} +{\left (m - n - 4\right )} \cos \left (f x + e\right ) +{\left ({\left (m - n - 2\right )} \cos \left (f x + e\right ) + 2\right )} \sin \left (f x + e\right ) - 2\right )} \left (g \cos \left (f x + e\right )\right )^{-2 \, m + 3}{\left (a \sin \left (f x + e\right ) + a\right )}^{m} e^{\left (2 \, n \log \left (g \cos \left (f x + e\right )\right ) - n \log \left (a \sin \left (f x + e\right ) + a\right ) + n \log \left (\frac{a c}{g^{2}}\right )\right )}}{2 \, f m^{2} + 2 \, f n^{2} -{\left (f m^{2} + f n^{2} - 5 \, f m -{\left (2 \, f m - 5 \, f\right )} n + 6 \, f\right )} \cos \left (f x + e\right )^{2} - 10 \, f m - 2 \,{\left (2 \, f m - 5 \, f\right )} n +{\left (f m^{2} + f n^{2} - 5 \, f m -{\left (2 \, f m - 5 \, f\right )} n + 6 \, f\right )} \cos \left (f x + e\right ) +{\left (2 \, f m^{2} + 2 \, f n^{2} - 10 \, f m - 2 \,{\left (2 \, f m - 5 \, f\right )} n +{\left (f m^{2} + f n^{2} - 5 \, f m -{\left (2 \, f m - 5 \, f\right )} n + 6 \, f\right )} \cos \left (f x + e\right ) + 12 \, f\right )} \sin \left (f x + e\right ) + 12 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: NotImplementedError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]